package com.woniuxy.mq.config;

import org.springframework.amqp.support.converter.Jackson2JsonMessageConverter;
import org.springframework.amqp.support.converter.MessageConverter;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author 饶志
 * @version 1.0
 * @since 2025-07-15  11:42
 */
@Configuration
public class RabbitMqConfig {

    /**
     * 配置JSON消息转换器
     * 用于将消息序列化为JSON格式，避免Java默认序列化的类权限问题
     */
    @Bean
    public MessageConverter jackson2JsonMessageConverter() {
        return new Jackson2JsonMessageConverter();
    }
}
